package J20250330_real;

/**
 * Created with IntelliJ IDEA.
 * Description: 迷宫——https://www.lanqiao.cn/problems/602/learning/?isWithAnswer=true
 * User: 王圆豪
 * Date: 2025-04-05
 * Time: 15:45
 */
import java.util.*;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main9 {
    static boolean[][] vis;
    static int[] dx = {1,-1,0,0};
    static int[] dy = {0,0,1,-1};
    static char[] point = {'D','U','R','L'};
    static List<String> ret = new ArrayList<>();
    static List<Character> path = new ArrayList<>();
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int[][] table = new int[30][50];
        vis = new boolean[30][50];
        for(int i = 0; i < 30; i++){
            String s = scan.nextLine();
            for(int j = 0; j < s.length(); j++){
                table[i][j] = (int)(s.charAt(j)-'0');
            }
        }
        dfs(0,0, table);
        System.out.println(func(ret));
        scan.close();
    }

    static void dfs(int x, int y, int[][] table){
        if(x == 29 && y == 49){
            StringBuffer s = new StringBuffer();
            for(char ch : path) s.append(ch);
            ret.add(s.toString());
            return;
        }
        for(int i = 0; i < 4; i++){
            int px = dx[i]+x,py = dy[i]+y;
            if(px>=0&&px<30&&py>=0&&py<50&&!vis[px][py]&&table[px][py]!=1){
                path.add(point[i]);
                vis[px][py] = true;
                dfs(px,py,table);
                vis[px][py] = false;
                path.remove(path.size()-1);
            }
        }
    }

    static String func(List<String> l){
        int sz = Integer.MAX_VALUE;
        for(String tmp : l){
            sz = Math.min(tmp.length(),sz);
        }
        List<String> cur = new ArrayList<>();
        for(String tmp : l){
            if(tmp.length() == sz) cur.add(tmp);
        }
        cur.sort(null);
        return cur.get(0);
    }
}